package com.dada.domain.vos;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * Created by jianweilin on 16/9/7.
 */
@Data
public class User {
    @NotNull
    private String name;

    @NotEmpty
    private String password;

    @NotBlank
    private String nickName;

    @Valid
    private Address address;

    public static void main(String[] args) {
        User user = new User();
        Address address = new Address();
        address.setPlaceNo(234);
        address.setPlace("shanghai");
        user.setPassword("12321");
        user.setName("zhangsan");
        user.setName("zhaowu");
        user.setAddress(address);
        System.out.println(JSON.toJSONString(user));
    }
}
